<html lang="en" xmlns:th="http://www.springframework.org/schema/data/jaxb">


<div class="layui-row">
    <form class="layui-form" id="create_fb_form" style="margin: 20px" lay-filter="create_fb_form">
        <input type="hidden" th:value="${obj.id}" id="id" name="id">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <h3 style="color: red">选择要生成分布式项目的模块:注意生成的各个模块都在同一包下面，</h3>
                <h3 style="color: red">如果不在同一个包下面请自行手动更改,生成代码之前请先设置包名和注册中心的注册名否则生成失败</h3>
            </div>
        <!--    <div class="layui-input-block">
                <input type="text" name="provider_package_name" value="包名例如：com.zbkj.cn"
                       title="provider_package_name">
            </div>
-->



            <div class="layui-input-block">
                <input type="checkbox" name="create" value="entity" title="entity">
                <input type="checkbox" name="create" value="mapper" title="mapper">
                <input type="checkbox" name="create" value="service" title="service">
                <input type="checkbox" name="create" value="controller" title="controller">
            </div>

            <div class="layui-input-block">
                <h3>接口层 接口层创建 service接口 vo dto</h3>
            </div>
            <div class="layui-input-block">
                <input type="checkbox" name="service_api" value="service_api" title="service_api">
            </div>

            <div class="layui-input-block">
                <h3>消费者层 controller</h3>
            </div>
            <div class="layui-input-block">
                <input type="checkbox" name="controller_cust" value="controller_cust" title="controller_cust">
            </div>

            <div class="layui-input-block">
                <h3>前端VUE</h3>
            </div>
            <div class="layui-input-block">
                <input type="checkbox" name="vue" value="vue" title="vue">
            </div>


            <div class="layui-input-block">
                <h3>后台全部生成</h3>
            </div>
            <div class="layui-input-block">
                <input type="checkbox" name="java_all" value="java_all" title="java_all">
            </div>

            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="">生成代码</button>
            </div>

        </div>
    </form>

</div>

<script th:inline="javascript">

    var field_form = layui.form;
    field_form.render(null, 'create_fb_form');
    field_form.on('submit(create_fb_form)', function () {
        var url =
        /*[[@{/createFb}]]*/
        var create = "";
        $('input:checkbox:checked').each(function (index, element) {
            create += element.value + ",";
        });

        var name=$("#provider_name").val();
        window.location.href = url + "?id=" + $("#id").val() + "&create=" + create+"&name="+name;

        return false;
    })


</script>